import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "/login",
    hidden:true,
    meta:{
      name:'主页'
    }
  },
  {
    path: "/login",
    name: "Login",
    hidden:true,
    meta:{
      name:'登录'
    },
    component: () => import("../views/Login.vue")
  },
  // 首页管理路由模块
  {
    path: "/console",
    name: "console",
    redirect: "/index",
    meta:{
      name:'控制中心',
      icon:'console'
    },
    component: () => import("../views/Layout/index.vue"),
    children:[
      {
        path: "/index",
        name: "index",
        meta:{
          name:'首页'
        },
        component:() => import("../views/Console/console.vue")
      }
    ]
  },
  // 信息管理路由模块
  {
    path: "/index",
    name: "index",
    meta:{
      name:'信息管理',
      icon:'info'

    },
    component: () => import("../views/Layout/index.vue"),
    children:[
      {
        path: "/infoList",
        name: "infoList",
        meta:{
          name:'信息列表'
        },
        component:() => import("../views/Info/infoList.vue")
      },
      {
        path: "/infoSort",
        name: "infoSort",
        meta:{
          name:'信息分类'
        },
        component:() => import("../views/Info/infoSort.vue")
      }
    ]
  },
  // 用户管理路由模块
  {
    path: "/index",
    name: "index",
    meta:{
      name:'用户管理',
      icon:'user'

    },
    component: () => import("../views/Layout/index.vue"),
    children:[
      {
        path: "/userList",
        name: "userList",
        meta:{
          name:'用户列表'
        },
        component:() => import("../views/User/userList.vue")
      },
    ]
  }
];

const router = new VueRouter({
  routes
});

export default router;
